import numpy as np

# ---- run Test
num: int = 0


def runTest(fun):
    global num
    print('----------------------', num)
    fun()
    num += 1
    print()


# -------------------------------------------- tests:

def test_inverse():
    arr1 = np.array(range(10))
    arrs = list(range(10))
    for i, j in zip(range(10), range(10, 20)):
        arrs[i] = np.add(arr1, np.sin(i) + np.cos(j))

    a = np.array(arrs)
    print("原数组:")
    print(a)
    b = np.linalg.inv(a)
    print("求逆:")
    print(b)


# ---------------------------------------- main
# Press the green button in the gutter to run the script.
if __name__ == '__main__':
    runTest(test_inverse)
